package com.heima.media.listener;

import com.heima.media.task.ArticleTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Component
public class ArticleDelayListener {

    @Autowired
    private ArticleTask articleTask;

    @PostConstruct  // 启动时自动执行该任务
    public void handleMessage() throws Exception {
        articleTask.handleMessage();
    }
}
